package cn.iocoder.yudao.module.pickbook.controller.app.user;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;

import cn.iocoder.yudao.module.pickbook.controller.app.user.vo.wxLoginCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import javax.annotation.security.PermitAll;
import javax.validation.Valid;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "前端 - 用户")
@RestController
@RequestMapping("/user")
@Validated
public class AppUserController {

    @PostMapping("/login")
    @Operation(summary = "登录")
    @PermitAll
    public CommonResult<Boolean> userLogin() {
//        System.out.println(o.toString());
        return success(true);
    }

    @PostMapping("/wxLogin")
    @Operation(summary = "登录")
    @PermitAll
    public CommonResult<Boolean> wxLogin(@Valid @RequestBody wxLoginCode code) {
        System.out.println(code.getCode());
        return success(true);
    }
}
